<?
include '../../config.php';
$templateNews = new TemplateNews();
$current_page		= getValue("page", "int", "GET", 1);
$news_cat_id		= getValue("news_cat_id", "int", "GET", 0);
?>
<?         
   $templateNews->page_size = 5;
   $templateNews->page = $current_page;
   if($news_cat_id <=0){
      $news = $templateNews->news();   
      $total = $templateNews->news_total();
   }else{
      $news = $templateNews->news_follow_cat_id($news_cat_id);   
      $total = $templateNews->news_follow_cat_id_total($news_cat_id);
   }
   foreach($news as $row){
?>
     <div class="news_one">
          <div class="news_item_img">
              <img alt="" src="<?=news_img.$row['new_picture']?>" />
          </div>
          <div class="news_item_main">
              <h3><?=cut_string($row['new_title'],70)?></h3>
              <p class="news_date">Đăng lúc: <?=getDateTime(1,1,1,1,'',$row['new_date'])?></p>
              <p>&nbsp;&nbsp;&nbsp;<?=cut_string($row['new_summary'],222)?></p>
              <div class="read_more">
                  <a href="<?=generate_news_detail_url($row)?>">Đọc thêm ...</a>
              </div>
          </div>
     </div>
<? } ?>
<div class="news_pagebreak">
   <? if($news_cat_id > 0){ ?>
      <input type="hidden" id="news_cat_id" value="<?=$news_cat_id?>" />
   <? } ?>
   <?=NewsPageBreak($url,$total,$templateNews->page_size,$current_page,'news_page')?>
</div>